
let fs = require("fs");


let axeKing = {
    "id": 2,
    "name": "npc_dota_hero_axe",
    "name_loc": "斧王",
    "order_id": 2,
    "name_english_loc": "Axe",
    "primary_attr": 0,
    "complexity": 1,
    "bio_loc": "作为红雾军团的一名步兵，蒙哥可汗的目标是成为红雾军团的将军。在一场又一场的战斗中，他用血腥的战果证明了自己的价值。他毫不犹豫杀死上级的行为帮助他完成了晋升。在长达七年的千湖之境战役中，他用光荣的杀戮给自己带来了荣誉，他的声望比从前更耀眼了，但他身边的战友也在一个个地减少。在最终战胜的夜晚，蒙哥可汗宣布他为红雾军团的新将军，并冠以自身“斧王”的头衔。但他的军队却只有他一人，虽然许多人是战死的，但更多人则是死在斧王的刃下。不用说，现在大多数战士都不想由他领导。但这对斧王来说不算什么，因为他的军队只需要他一个人就够了。",
    "hype_loc": "一个接着一个，斧王将他的敌人斩落。作为团队的先锋，他<b>使敌人陷入战斗</b>，<b>致命的旋斧</b>会对他们的攻击作出回应。一旦敌人出现衰迹，他将挥舞着<b>淘汰之刃</b>挺身而出。",
    "npe_desc_loc": "嘲讽敌人，使其强制攻击他",
    "str_base": 25, // 力量
    "str_gain": 2.8,    // 力量成长
    "agi_base": 20, // 敏捷
    "agi_gain": 2,  // 敏捷成长
    "int_base": 18, // 智力
    "int_gain": 1.6,    // 智力成长
    "attack_capability": 1, // 攻速
    "role_levels": [1, 0, 0, 2, 2, 3, 0, 0, 3],
    "damage_min": 55, // 基础攻击
    "damage_max": 59, // 基础攻击
    "attack_rate": 1.7, // 攻击间隔
    "attack_range": 150, // 攻击距离
    "projectile_speed": 900, // 弹道速率
    "armor": 2.3333335, // 护甲
    "magic_resistance": 25, // 法抗
    "movement_speed": 310, // 移速
    "turn_rate": 0.6, // 转身速率
    "sight_range_day": 1800, // 白天视野
    "sight_range_night": 800, // 夜间视野
    "max_health": 700,  // hp
    "health_regen": 5,  // hpRegen
    "max_mana": 291,  // mp
    "mana_regen": 0.90000004,  // mpRegen
    "abilities": [{
        "id": 5007,
        "name": "axe_berserkers_call",
        "name_loc": "狂战士之吼",
        "desc_loc": "斧王嘲讽附近的敌方单位，强迫他们攻击自己，同时获得额外护甲。",
        "lore_loc": "蒙哥可汗的狂吼嘲讽使敌人不得不与他作战。",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "狂战士之吼对作用的单位施加战斗饥渴。降低狂战士之吼的冷却时间。",
        "type": 0,
        "behavior": "262148",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 3,
        "dispellable": 3,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0.3],
        "channel_times": [0],
        "cooldowns": [17, 15, 13, 11],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [80, 90, 100, 110],
        "gold_costs": [],
        "special_values": [{
            "name": "radius",
            "values_float": [300],
            "is_percentage": false,
            "heading_loc": "作用范围：",
            "bonuses": [{
                "name": "special_bonus_unique_axe_2",
                "value": 100,
                "operation": 0
            }]
        }, {
            "name": "bonus_armor",
            "values_float": [25],
            "is_percentage": false,
            "heading_loc": "护甲提升：",
            "bonuses": [{
                "name": "special_bonus_unique_axe_7",
                "value": 8,
                "operation": 0
            }]
        }, {
            "name": "duration",
            "values_float": [2, 2.4, 2.8, 3.2],
            "is_percentage": false,
            "heading_loc": "持续时间：",
            "bonuses": []
        }, {
            "name": "scepter_cooldown_reduction",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "冷却时间减少：",
            "bonuses": []
        }, {
            "name": "applies_battle_hunger",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0.3],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [80, 90, 100, 110],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [17, 15, 13, 11],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": true,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0,
        "img": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_berserkers_call.png",
        "video_jpg": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_berserkers_call.jpg",
        "video_mp4": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_berserkers_call.mp4",
        "video_webm": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_berserkers_call.webm",
        "video_scepter_jpg": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_scepter.jpg",
        "video_scepter_mp4": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_scepter.mp4",
        "video_scepter_webm": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_scepter.webm"
    }, {
        "id": 5008,
        "name": "axe_battle_hunger",
        "name_loc": "战斗饥渴",
        "desc_loc": "激怒一个敌方单位，使他受到持续伤害，直到他杀死一个单位或者持续时间结束。伤害量会根据斧王的护甲而增加。敌人只要背朝斧王还将被减速。",
        "lore_loc": "通常英雄都无法抵挡蒙哥可汗的战斗狂怒，他们会一直受伤，直到蒙哥可汗的狂怒平息。",
        "notes_loc": ["摧毁建筑也能移除该状态效果。"],
        "shard_loc": "",
        "scepter_loc": "战斗饥渴还会降低敌人的护甲，并且每有一个单位受到作用，斧王就会提升7点护甲。",
        "type": 0,
        "behavior": "8",
        "target_team": 2,
        "target_type": 19,
        "flags": 0,
        "damage": 1,
        "immunity": 4,
        "dispellable": 2,
        "max_level": 4,
        "cast_ranges": [700, 775, 850, 925],
        "cast_points": [0.3, 0.3, 0.3, 0.3],
        "channel_times": [0],
        "cooldowns": [20, 15, 10, 5],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [50, 60, 70, 80],
        "gold_costs": [],
        "special_values": [{
            "name": "duration",
            "values_float": [12],
            "is_percentage": false,
            "heading_loc": "持续时间：",
            "bonuses": []
        }, {
            "name": "slow",
            "values_float": [-11, -19, -27, -35],
            "is_percentage": true,
            "heading_loc": "移动速度减缓：",
            "bonuses": [{
                "name": "special_bonus_unique_axe_6",
                "value": 12,
                "operation": 2
            }]
        }, {
            "name": "damage_per_second",
            "values_float": [10, 15, 20, 25],
            "is_percentage": false,
            "heading_loc": "每秒伤害：",
            "bonuses": []
        }, {
            "name": "armor_multiplier",
            "values_float": [1],
            "is_percentage": false,
            "heading_loc": "护甲倍数：",
            "bonuses": [{
                "name": "special_bonus_unique_axe",
                "value": 2,
                "operation": 1
            }]
        }, {
            "name": "scepter_armor_change",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "护甲改变：",
            "bonuses": []
        }, {
            "name": "speed_bonus",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": [{
                "name": "special_bonus_unique_axe_8",
                "value": 10,
                "operation": 0
            }]
        }, {
            "name": "AbilityCastRange",
            "values_float": [700, 775, 850, 925],
            "is_percentage": false,
            "heading_loc": "施法距离：",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0.3],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [50, 60, 70, 80],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [20, 15, 10, 5],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": true,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0,
        "img": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_battle_hunger.png",
        "video_jpg": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_battle_hunger.jpg",
        "video_mp4": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_battle_hunger.mp4",
        "video_webm": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_battle_hunger.webm",
        "video_scepter_jpg": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_scepter.jpg",
        "video_scepter_mp4": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_scepter.mp4",
        "video_scepter_webm": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_scepter.webm"
    }, {
        "id": 5009,
        "name": "axe_counter_helix",
        "name_loc": "反击螺旋",
        "desc_loc": "受攻击时，斧王有几率做出螺旋反击，对附近所有敌方单位造成纯粹伤害。",
        "lore_loc": "这支军队只要有斧王就不需要援军了。",
        "notes_loc": ["反击螺旋会在斧王受到攻击时触发。"],
        "shard_loc": "反击螺旋现在对击中的敌人施加一个可叠加的负面效果，使其对斧王造成的攻击伤害减少。反击螺旋的几率提升。 ",
        "scepter_loc": "",
        "type": 0,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 4,
        "immunity": 3,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0.3],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "damage",
            "values_float": [60, 100, 140, 180],
            "is_percentage": false,
            "heading_loc": "伤害：",
            "bonuses": [{
                "name": "special_bonus_unique_axe_4",
                "value": 30,
                "operation": 0
            }]
        }, {
            "name": "radius",
            "values_float": [275],
            "is_percentage": false,
            "heading_loc": "作用范围：",
            "bonuses": []
        }, {
            "name": "trigger_chance",
            "values_float": [17, 18, 19, 20],
            "is_percentage": true,
            "heading_loc": "反击概率：",
            "bonuses": []
        }, {
            "name": "cooldown",
            "values_float": [0.3],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "shard_debuff_duration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "负面状态持续时间：",
            "bonuses": []
        }, {
            "name": "shard_damage_reduction",
            "values_float": [0],
            "is_percentage": true,
            "heading_loc": "攻击伤害降低：",
            "bonuses": []
        }, {
            "name": "shard_max_stacks",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "最大叠加数：",
            "bonuses": []
        }, {
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0.3],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": true,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0,
        "img": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_counter_helix.png",
        "video_jpg": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_counter_helix.jpg",
        "video_mp4": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_counter_helix.mp4",
        "video_webm": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_counter_helix.webm",
        "video_shard_jpg": "https://img.dota2.com.cn/dota2static/herostatic/upgrade/npc_dota_hero_axe/axe_aghanims_shard.jpg",
        "video_shard_mp4": "https://img.dota2.com.cn/dota2static/file/599c7e51-f600-4f3f-9d44-d61ecee84cf8.mp4",
        "video_shard_webm": "https://img.dota2.com.cn/dota2static/file/87cc3915-3fe9-4593-b41c-aeee39a04951.webm"
    }, {
        "id": 5010,
        "name": "axe_culling_blade",
        "name_loc": "淘汰之刃",
        "desc_loc": "斧王洞察到弱点并出击，造成纯粹伤害。淘汰之刃击杀敌方英雄时将重置冷却时间，并且斧王永久获得护甲加成，而附近所有友军单位获得移动速度加成。",
        "lore_loc": "蒙哥可汗是战斗与狂怒的化身，胆敢与斧王为敌者只有死路一条。",
        "notes_loc": ["淘汰之刃的斩杀效果无法被薄葬等技能阻止。"],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 1,
        "behavior": "8",
        "target_team": 2,
        "target_type": 19,
        "flags": 16,
        "damage": 4,
        "immunity": 3,
        "dispellable": 2,
        "max_level": 3,
        "cast_ranges": [175],
        "cast_points": [0.3],
        "channel_times": [0],
        "cooldowns": [100, 85, 70],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [100, 125, 150],
        "gold_costs": [],
        "special_values": [{
            "name": "damage",
            "values_float": [250, 350, 450],
            "is_percentage": false,
            "heading_loc": "伤害：",
            "bonuses": [{
                "name": "special_bonus_unique_axe_5",
                "value": 150,
                "operation": 0
            }]
        }, {
            "name": "speed_bonus",
            "values_float": [20, 25, 30],
            "is_percentage": true,
            "heading_loc": "斩杀后移动速度加成：",
            "bonuses": []
        }, {
            "name": "atk_speed_bonus",
            "values_float": [20, 30, 40],
            "is_percentage": false,
            "heading_loc": "斩杀后攻击速度加成：",
            "bonuses": []
        }, {
            "name": "speed_duration",
            "values_float": [6],
            "is_percentage": false,
            "heading_loc": "斩杀加速持续时间：",
            "bonuses": []
        }, {
            "name": "speed_aoe",
            "values_float": [900],
            "is_percentage": false,
            "heading_loc": "斩杀后加速范围：",
            "bonuses": []
        }, {
            "name": "charge_speed",
            "values_float": [1200],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "armor_per_stack",
            "values_float": [1, 1.5, 2],
            "is_percentage": false,
            "heading_loc": "每次击杀护甲加成：",
            "bonuses": [{
                "name": "special_bonus_unique_axe_3",
                "value": 1,
                "operation": 0
            }]
        }, {
            "name": "AbilityCastRange",
            "values_float": [175],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0.3],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [100, 125, 150],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [100, 85, 70],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0,
        "img": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_culling_blade.png",
        "video_jpg": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_culling_blade.jpg",
        "video_mp4": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_culling_blade.mp4",
        "video_webm": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/axe_culling_blade.webm"
    }],
    "talents": [{
        "id": 974,
        "name": "special_bonus_unique_axe_7",
        "name_loc": "+{s:bonus_bonus_armor} 狂战士之吼护甲",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 9401,
        "name": "special_bonus_unique_axe_8",
        "name_loc": "战斗饥渴每作用一个目标提供+{s:bonus_speed_bonus}% 移动速度",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 670,
        "name": "special_bonus_unique_axe_6",
        "name_loc": "+{s:bonus_slow}% 战斗饥渴减速",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 6991,
        "name": "special_bonus_unique_axe_4",
        "name_loc": "+{s:bonus_damage} 反击螺旋伤害",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 562,
        "name": "special_bonus_unique_axe_5",
        "name_loc": "+{s:bonus_damage} 淘汰之刃伤害",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 6815,
        "name": "special_bonus_unique_axe_3",
        "name_loc": "+{s:bonus_armor_per_stack} 淘汰之刃额外护甲",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 6608,
        "name": "special_bonus_unique_axe_2",
        "name_loc": "+{s:bonus_radius} 狂战士之吼范围",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }, {
        "id": 6102,
        "name": "special_bonus_unique_axe",
        "name_loc": "{s:bonus_armor_multiplier} 战斗饥渴护甲系数",
        "desc_loc": "",
        "lore_loc": "",
        "notes_loc": [],
        "shard_loc": "",
        "scepter_loc": "",
        "type": 2,
        "behavior": "2",
        "target_team": 0,
        "target_type": 0,
        "flags": 0,
        "damage": 0,
        "immunity": 0,
        "dispellable": 0,
        "max_level": 4,
        "cast_ranges": [0],
        "cast_points": [0],
        "channel_times": [0],
        "cooldowns": [0],
        "durations": [0],
        "damages": [0, 0, 0, 0],
        "mana_costs": [0],
        "gold_costs": [],
        "special_values": [{
            "name": "AbilityCastRange",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChannelTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityDuration",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCastPoint",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCharges",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityChargeRestoreTime",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityManaCost",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }, {
            "name": "AbilityCooldown",
            "values_float": [0],
            "is_percentage": false,
            "heading_loc": "",
            "bonuses": []
        }],
        "is_item": false,
        "ability_has_scepter": false,
        "ability_has_shard": false,
        "ability_is_granted_by_scepter": false,
        "ability_is_granted_by_shard": false,
        "item_cost": 0,
        "item_initial_charges": 0,
        "item_neutral_tier": 4294967295,
        "item_stock_max": 0,
        "item_stock_time": 0,
        "item_quality": 0
    }],
    "index_img": "https://img.dota2.com.cn/dota2static/herostatic/index/npc_dota_hero_axe.png",
    "crops_img": "https://img.dota2.com.cn/dota2static/herostatic/crops/npc_dota_hero_axe.png",
    "top_img": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/npc_dota_hero_axe.png",
    "top_video": "https://img.dota2.com.cn/dota2static/herostatic/npc_dota_hero_axe/npc_dota_hero_axe.webm",
    "update_time": 1668528007,
    "mid_img": "https://img.dota2.com.cn/dota2static/herostatic/index/npc_dota_hero_axe.png"
}
;
(async () => {
    let herosDatas = JSON.parse(fs.readFileSync("./cache/heroData.json").toString())
    for (let id in herosDatas) {
        herosDatas[id] = await analysisHero(herosDatas[id].heroes, 20)
    }
    let heroArr = Object.values(herosDatas);
    fs.writeFileSync("./cache/heroDataAnalysis.json", JSON.stringify(herosDatas));

    heroArrSortDps = heroArr.sort((a,b) => b.dps - a.dps)
    fs.writeFileSync("./cache/dpsSort.json", JSON.stringify(heroArrSortDps));

    heroArrSortWuLi = heroArr.sort((a,b) => b.wuliHp - a.wuliHp)
    fs.writeFileSync("./cache/wuliDef.json", JSON.stringify(heroArrSortWuLi));

    heroArrSortWuLi = heroArr.sort((a,b) => (b.strength + b.agi) - (a.strength-a.agi)) 
    fs.writeFileSync("./cache/limin.json", JSON.stringify(heroArrSortWuLi));
    
    fightMoniData = heroArr.sort((a, b) => fightMoni(a, b))
    fs.writeFileSync("./cache/fight.json", JSON.stringify(heroArrSortWuLi));

    fightMoniData = heroArr.sort((a, b) => b.dazhuang - a.dazhuang)
    fs.writeFileSync("./cache/daZHuang.json", JSON.stringify(heroArrSortWuLi));
})()

// 宽容(移速 攻速) bkb 血ji 怨灵报复 希瓦守护 强袭 魔晶



async function analysisHero(heroData, lv=1, items) {
    let {primary_attr,str_base,str_gain,agi_base,agi_gain,int_base,int_gain,
        max_health,health_regen,max_mana,mana_regen,
        armor,magic_resistance,movement_speed,name_loc,name_english_loc,
        damage_min,damage_max,attack_rate,attack_range,attack_capability
    } = heroData;

    let heroStrength =  str_gain * (lv - 1) ; // normal attr
    let heroAgi =  agi_gain * (lv - 1); // normal attr
    let heroInt =  int_gain * (lv - 1); // normal attr
    let heroHp = max_health
    let heroHpRegen = health_regen
    let heroMp = max_mana
    let heroMpRegen = mana_regen
    let heroArmor = armor
    let heroMagicResistance = magic_resistance
    let heroMoveSpeed = movement_speed
    let heroAttack = (damage_min + damage_max) / 2
    let heroAtkLong = attack_range
    let heroAtkUseTime = attack_rate
    let heroAtkSpeed = attack_capability;
    let heroType = primary_attr // [0,1,2] Strength heroAgi heroInt
    
    
    
    // items jiacheng

    let mianban = {
        name: name_loc,
        strength: heroStrength + str_base,
        agi: heroAgi + agi_base,
        int: heroInt + int_base,
        attrPoint: heroStrength + str_base +heroAgi + agi_base +heroInt + int_base,
        hp: heroHp + heroStrength*17.8,
        hpRegen: heroHpRegen+heroStrength*0.1,
        mp: heroMp + heroInt * 11.2,
        mpRegen: heroMpRegen + heroInt * 0.05,
        armor: heroArmor + heroAgi/6,
        magicRes: heroMagicResistance,
        moveSpeed: heroMoveSpeed,
        attack: heroAttack + (heroType == 0? heroStrength : (heroType == 1 ?heroAgi :heroInt)),
        atkUseTime: heroAtkUseTime,
        atkSpeed: heroAtkSpeed + (heroAgi/100)*1, 
        atkLong: heroAtkLong,
    }
    // 计算攻速 每秒打多少下
    mianban.dpKit = 1 / ((1/mianban.atkSpeed) * mianban.atkUseTime)
    mianban.dps = mianban.dpKit * mianban.attack
    mianban.wuliHp = mianban.hp * defTurnHp(mianban.armor)
    mianban.dazhuang = atkBazi(mianban)

    
    // 62 3 310   31 24 21
    // 800 327   15.7  1.1
    return mianban
}



function fightMoni(p1, p2) {
    let fightSecond = 0
    let p1Hp = p1.hp
    let p2Hp = p2.hp

    while (fightSecond < 1000) {
        fightSecond++;
        // base 互 a
        p1Hp -= p2.dps * defReduce(p1.armor)
        p2Hp -= p1.dps * defReduce(p2.armor)
        // dead 判定
        if(p1Hp <= 0) {
            return 1
        } else if (p2Hp <= 0) {
            return -1
        }
        // 回复
        p1Hp += p1.hpRegen
        p2Hp += p2.hpRegen
    }
}

function atkBazi(p1) {
    let fightSecond = 0
    let p1Hp = p1.hp
    let baziHp = 0
    let baziArmor = 6
    let baziAtk = 150
    while (fightSecond < 1000) {
        fightSecond++;
        // base 互 a
        p1Hp -= baziAtk * defReduce(p1.armor)
        baziHp += p1.dps * defReduce(baziArmor)
        // dead 判定
        if(p1Hp <= 0) {
            break
        }
        // 回复
        p1Hp += p1.hpRegen
    }
    return baziHp
}


function defTurnHp(armor) {
    return 1+(armor * 0.06 / ( 1 + Math.abs(armor) * 0.06))
}


function defReduce(armor) {
    return 1-(armor * 0.06 / ( 1 + Math.abs(armor) * 0.06))
}



// 7.1